﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace TowerDefence.Entities.Actions
{
    public abstract class Action
    {
        protected Entity userEntity;
        protected List<Entity> targetEntities;

        /// <summary>
        /// Is the action currently active?
        /// Allows containing entity to remove reference.
        /// </summary>
        public bool Active { get; protected set; }

        /// <summary>
        /// Creates an action. Not sure if action should get references to whole entities,
        /// or just to their states, since that's all it needs to know about/act on...
        /// </summary>
        public Action(Entity _userEntity, params Entity[] _targetEntities)
        {
            this.userEntity = _userEntity;
            if (_targetEntities != null)
            {
                this.targetEntities = new List<Entity>(_targetEntities);
            }
            Active = true;
        }        

        public abstract void DoAction(TimeSpan _time);
    }
}
